<?php

namespace App\Console\Commands;

use App\Common\Services\ErrorLogService;
use App\Common\Tools\CustomException;
use App\Services\FeishuService;
use Illuminate\Console\Command;

class SyncEmployeeCommand extends Command
{
    /**
     * 命令行执行命令
     * @var string
     */
    protected $signature = 'sync_employee';

    /**
     * 命令描述
     *
     * @var string
     */
    protected $description = '同步员工列表';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct(){
        parent::__construct();
    }

    /**
     * 处理
     */
    public function handle(){
        $feishuService = new FeishuService();
        $employees = $feishuService->syncEmployees();
        $count = count($employees);
        $this->info("sync success({$count})! \n");
    }
}
